UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fqMEEJ73dicbGr8vEqkuB/ryj4cLrzakme+86LUaRC8=' 
WHERE 
  key_id = '92355b4a24a6f608f322edd2f2b58ecb9b22014bb71000ee96622403f5b942ae' 
  AND (
    token = 'fqMEEJ73dicbGr8vEqkuB/ryj4cLrzakme+86LUaRC8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038