UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wcArWYNgEyTcZ7Yau7ECUC7r8dIpqQfWFpNibGU1R5k=' 
WHERE 
  key_id = '7dc86d11c2f6893323e1b6e83da9bc111221e9649ebf7190f9c58363e00eb336' 
  AND (
    token = 'wcArWYNgEyTcZ7Yau7ECUC7r8dIpqQfWFpNibGU1R5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016