UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u2woH20dPGapwGcIvqCI6N5QWoVqG2X9N6WMrb47Amw=' 
WHERE 
  key_id = 'b91b0b2ff8681ad9c1a29edd3952320a5fc72648bc2fe5f5e30f6005f379e249' 
  AND (
    token = 'u2woH20dPGapwGcIvqCI6N5QWoVqG2X9N6WMrb47Amw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039