UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8xdJXfQE5ziunkI+ObjLjjmlIKyRSa/gi82rxQbC21Q='
WHERE
key_id = 'ee5fef56cecd48fbef4245c09117c6f0a51798f6971bd036102fd6b684b6364f'
AND (
token = '8xdJXfQE5ziunkI+ObjLjjmlIKyRSa/gi82rxQbC21Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)