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

Query time 0.00045