UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nqy3Zs1nv2sI6zzE7WX6R0AStkKcEqHZShHQDixe77U='
WHERE
key_id = '3c17a2016a2f47feecef132401d0e1bbbb09e25279a8a590864106740fefc1c4'
AND (
token = 'nqy3Zs1nv2sI6zzE7WX6R0AStkKcEqHZShHQDixe77U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)