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

Query time 0.00027