UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SoGJywnVF8DOsIz7AhqwKGs7KUzqGqjJWRvpIVNoSjU=' 
WHERE 
  key_id = '343e09640e4bf3a014d5959dcb10814ea30d879263cafb49a920e49757eccdaa' 
  AND (
    token = 'SoGJywnVF8DOsIz7AhqwKGs7KUzqGqjJWRvpIVNoSjU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017