UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '86DlS4x4tnafdTYaZlwOESrvfNyErmsgVQNgDhzaFWk=' 
WHERE 
  key_id = '31230aa00fea566eb4abca9858836b2d57a08d139d9463bf74fcc1e66999330b' 
  AND (
    token = '86DlS4x4tnafdTYaZlwOESrvfNyErmsgVQNgDhzaFWk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015