UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kQEHIsjIG7b2x3/EH/lsCMEiR8fC+YeWY63GbrVGdKg=' 
WHERE 
  key_id = '805b454ecbf453306456e9d5678325f37b7551e17639dc92f7a9f70ce76b2002' 
  AND (
    token = 'kQEHIsjIG7b2x3/EH/lsCMEiR8fC+YeWY63GbrVGdKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031