UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zjS9GAnSCLgvVmiw3wGySv1RaVezG69sA+6zJb2xCWI='
WHERE
key_id = '9a00de1a75bf2df6a2217cef3ecdeff1596a094eec2add5b0a8fd4248ba243a7'
AND (
token = 'zjS9GAnSCLgvVmiw3wGySv1RaVezG69sA+6zJb2xCWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)