UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G6w9UljCKPsHv3dtskOsdDGas+HA84bu8tnmZwN8qzk='
WHERE
key_id = 'c212e88ecf528c034a85087ccc9176c9ed42397a17ce0f7620beeca9423e9c59'
AND (
token = 'G6w9UljCKPsHv3dtskOsdDGas+HA84bu8tnmZwN8qzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)