UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BW75lC78ZRFqJ4x2imkhZVz6I1qP5p2O/1etre737Gs=' 
WHERE 
  key_id = 'edc3d42c3719276bd0ca64faf8c6b025842abda5283b9f314394c24c9770b443' 
  AND (
    token = 'BW75lC78ZRFqJ4x2imkhZVz6I1qP5p2O/1etre737Gs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037