UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aKEiD1wzVXibsEfIWFVhg23DPTPSQyDbXyuksh0vFXA='
WHERE
key_id = '48336ca2fe40c9fd703600aedb834769606655ad04e3d959244a4646fd1020bb'
AND (
token = 'aKEiD1wzVXibsEfIWFVhg23DPTPSQyDbXyuksh0vFXA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)