UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TbV5Xar8hElC23nN8hxJ9ZYEqkrGfzhCRx1hOBhjI/o='
WHERE
key_id = 'b01ade7c65f084ec2566e5b4c8754cad40713a8ef08de48dca448f5dab4490ad'
AND (
token = 'TbV5Xar8hElC23nN8hxJ9ZYEqkrGfzhCRx1hOBhjI/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)