UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pHZpSxcE1salOCmlLXHxzztKmjThx18vdajSOrgN6xs='
WHERE
key_id = '7c6dba9ec5fcf26a7f1ca475fcc60560f3ff7c21ee66e130223c48d80b94e329'
AND (
token = 'pHZpSxcE1salOCmlLXHxzztKmjThx18vdajSOrgN6xs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)