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

Query time 0.00036