UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IKRt80G8iyxLNFSR6HszdeofdHLMqzWHTVD09/wEQns='
WHERE
key_id = '3daaf4732c4d27f709d6d2dd64b80a1bf10d8e90ed184d34dcb271d04b9525f4'
AND (
token = 'IKRt80G8iyxLNFSR6HszdeofdHLMqzWHTVD09/wEQns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)