UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zaf78gLzxxs6FvPV8mGGgWgmgR+xBgFzK4+XQjUgGs8='
WHERE
key_id = '920241721fbc6c59c119490a470b3f052a2a519baded38a9b9d0bb17b3da4ff8'
AND (
token = 'zaf78gLzxxs6FvPV8mGGgWgmgR+xBgFzK4+XQjUgGs8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)