UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DphFsg91zzlYUR1qVEmOQZ378HLH5T1STbLuR4DjEyI='
WHERE
key_id = 'e7ca8a1cd5f75da72294b74d8fd26c0ca4fcce002523deb1ad38d2e54dcf3abf'
AND (
token = 'DphFsg91zzlYUR1qVEmOQZ378HLH5T1STbLuR4DjEyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)