UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zyv2ijtxHuQLeeWIOnDx5nt0XcLeYAJqemcx0J186vU='
WHERE
key_id = 'a1c9dfd35ebaecee123969e3cf5576a13906082c2af76d23c2b9e04f5925b502'
AND (
token = 'Zyv2ijtxHuQLeeWIOnDx5nt0XcLeYAJqemcx0J186vU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)