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