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