UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZTpwsF8gae4u1ruVFBxD7ujYlluWfT4l/cRA9bPKnDw='
WHERE
key_id = 'dce59fc1cb867da7d0ac6608aa6a86c351e0648626659099295b0703afd4a8d5'
AND (
token = 'ZTpwsF8gae4u1ruVFBxD7ujYlluWfT4l/cRA9bPKnDw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)