UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '938PNrT6uqFmWiqKMgZum8l3BZIaeyttjGI3GdOUFuE='
WHERE
key_id = '4a9c10a98be04cb52357667a30524a3fba8bb7b6f90d34fb6b72bb007242e2b6'
AND (
token = '938PNrT6uqFmWiqKMgZum8l3BZIaeyttjGI3GdOUFuE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)