UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MSYYxLEqSF9FymAumqfpVmocG1DRNwTI/juOuApy0i0=' 
WHERE 
  key_id = '381411fe66064b661b58ac08252e5462a6f3f6bb31b94bc4b72338abd59537cb' 
  AND (
    token = 'MSYYxLEqSF9FymAumqfpVmocG1DRNwTI/juOuApy0i0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037