UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iM7zqJIrBLfPP4S1d3wPEa3NNeRvc1/VVTDorRyqrjg=' 
WHERE 
  key_id = '7134153d591bd33a23705e9bd26152d6b4e67c805c6f426b4cd2225d731e98b9' 
  AND (
    token = 'iM7zqJIrBLfPP4S1d3wPEa3NNeRvc1/VVTDorRyqrjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041