UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Znsj3rPIVkEOFDQaguqvo/9dWaLUAQV0Xhd73JxUoA=' 
WHERE 
  key_id = '9bb7cf79fb5387636967935a61ce44ae430ad87cd0203b5076104fbd1d39617d' 
  AND (
    token = '1Znsj3rPIVkEOFDQaguqvo/9dWaLUAQV0Xhd73JxUoA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047