UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dYIHYV1lGyezJhpfMkS1lmv0YD+BXyblAvUBPNozaXs='
WHERE
key_id = '85db9086ea29bd390a2327e0a6b712d11daf52fe5c9cfcacfffb6b90d9b403cf'
AND (
token = 'dYIHYV1lGyezJhpfMkS1lmv0YD+BXyblAvUBPNozaXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)