UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wji6Btgks0GmsbZDF9dwSJMooY9W4enV0oIa3cE/IeU='
WHERE
key_id = '902804a75925c59cc6e41dcd16e1c43c635af1ae2e15af701a8a8a687cc6cb9c'
AND (
token = 'Wji6Btgks0GmsbZDF9dwSJMooY9W4enV0oIa3cE/IeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)