UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vUqtZhGo/WZWl1eHgL6vsSvy2Nxk7uxMrEKEkd4z930=' 
WHERE 
  key_id = '04ddf370ee733ebda7a7d44cd62790bd933ba8b30e418587959513b88ec60ff3' 
  AND (
    token = 'vUqtZhGo/WZWl1eHgL6vsSvy2Nxk7uxMrEKEkd4z930=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036