UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dT6QEMn6AkH5UMu96soxWyYX5nlbfiZMFxzNoHa4N4M='
WHERE
key_id = '9503b3325decc45ac383a51c60c5d17c4b08ae50f5b388c4b37e448f4ae22a43'
AND (
token = 'dT6QEMn6AkH5UMu96soxWyYX5nlbfiZMFxzNoHa4N4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)