UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NIyyTUrG4mz5sccgnXnpX4MGmzM02FG8+JuK2n2/+YU=' 
WHERE 
  key_id = '63961876af16a2670d05c3be6dcf0ed6c04031e9e7ef384aaedaa130b9bb93b1' 
  AND (
    token = 'NIyyTUrG4mz5sccgnXnpX4MGmzM02FG8+JuK2n2/+YU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039