UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fZxlOVDyPMMQeKrveUh4oh6EKjInu9RS01pvm4ecRKE='
WHERE
key_id = '71b23c72cf48cc7a1ee0ca1a6335aae93fe11d38c1fdb36068e638d0e03fdb0f'
AND (
token = 'fZxlOVDyPMMQeKrveUh4oh6EKjInu9RS01pvm4ecRKE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)