UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y78Qo9WEF3GGnDm+jtFTvitySIKROkLb8fwPng+kasY='
WHERE
key_id = 'fc3ecdb6cb31d94d8355a72302d4858ad032aebce3a10cdce26544d82e58aeac'
AND (
token = 'y78Qo9WEF3GGnDm+jtFTvitySIKROkLb8fwPng+kasY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)