UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0xPcqnkpjyxTz2pcctKWZOflXSAnPndNv0h07gIMln0='
WHERE
key_id = 'e9c6ac0bebd601e9b7ef2e2322197591887a7646c2db3da071f8a0867e55d371'
AND (
token = '0xPcqnkpjyxTz2pcctKWZOflXSAnPndNv0h07gIMln0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)