UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+zM8gfpnGEtZZUxttb5+qdYGqD4FeHrtl+4PDlrsaIY='
WHERE
key_id = 'b9adea604ae4d97d1c397732f20ecae33af8fbc019600421946a9b5ee0777a61'
AND (
token = '+zM8gfpnGEtZZUxttb5+qdYGqD4FeHrtl+4PDlrsaIY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)