UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2XELqRK2Ige3SLSVO2LSJsVcrkYApq6JWGoE9QwZxe0=' 
WHERE 
  key_id = '6967939bce834e5988827cce247c82f67a86b78955f1f2f4d485c0969d1de2cf' 
  AND (
    token = '2XELqRK2Ige3SLSVO2LSJsVcrkYApq6JWGoE9QwZxe0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047