UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'trl2v8ikuPqG5dBAqOIhZa0jY0z79yjHGUFzMgSiImE='
WHERE
key_id = 'e35e144d71de72cd738addb7d7a5a2a84262ee1d4f54a29c791dd2a1260b893e'
AND (
token = 'trl2v8ikuPqG5dBAqOIhZa0jY0z79yjHGUFzMgSiImE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)