UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XzyUK8HOZMB0wTDdcQKPBRnQCest86ucCn1oT16Lw0U='
WHERE
key_id = '2a75d6070bb2d5a0ae612ab573a7101d8971aaa0152d1d00ad358c9c85783558'
AND (
token = 'XzyUK8HOZMB0wTDdcQKPBRnQCest86ucCn1oT16Lw0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)